home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
asmbatch.arc
/
ASMBATCH.DOC
< prev
next >
Wrap
Text File
|
1986-06-12
|
8KB
|
159 lines
ASM2COM.BAT
This batch file provides an automated method of producing a COM
file from a single assembly language source file. In addition to the
COM file, a LST file is also generated. The OBJ and EXE files (by-
products of the process) are deleted when no longer needed. Other files
are not generated.
ASM2COM does some rudimentary input checking to insure the source
is not accidentally destroyed or that the processors are not invoked for
nonexistent files. Any options specified (field 2) are assumed to be
for the assembler. Options are not checked, just applied. The /N
option is always defined to suppress the generation of symbol tables (as
I generally find the printout of little use).
Following the assembler invocation, ERRORLEVEL 1 is checked. The
IBM Macro Assembler (and for all I know versions of the Microsoft Macro
Assembler after 1.27) will set the ERRORLEVEL flag if errors are
detected. The following ECHO and PAUSE statements, REM'd out, provide a
similar function if the assembler does not set the ERRORLEVEL flag.
To invoke the assembly process, the user submits a statement
patterned as follows:
ASM2COM filename [options]
where "filename" is the file name of the assembly source WITH NO
EXTENSION! "[options]" is an optional field consisting of one or more
parameters to the assembler (without any imbedded spaces). Assuming the
file exists, a COM file will be produced as described above.
ASM2EXE.BAT
This batch file provides an automated method of producing a EXE
file from a single assembly language source file. In addition to the
EXE file, a LST file is also generated. The OBJ file (a by-product of
the process) is deleted after the linking. Other files are not
generated.
ASM2EXE does some rudimentary input checking to insure the source
is not accidentally destroyed or that the processors are not invoked for
nonexistent files. (Assembler parameters, such as /N, must be hard coded
in the batch file if desired.) Any field 2 specifications are assumed to
be for the linker. The specifications are not checked, just applied.
Following the assembler invocation, ERRORLEVEL 1 is checked. The
IBM Macro Assembler (and for all I know versions of the Microsoft Macro
Assembler after 1.27) will set the ERRORLEVEL flag if errors are
detected. The following ECHO and PAUSE statements, REM'd out, provide a
similar function if the assembler does not set the ERRORLEVEL flag.
ASM2EXE will accept an optional field for the linker (LINK). If a
linker option is specified (such as /H to produce an EXE file for use
with a BASIC program), this option field will be provided to the linker.
If a library name (with no extension) is specified in field 2, the field
is supplied to the linker as a library name (with no linker options
supported). No checking is done on the second field with correctness the
sole responsibility of the user.
To invoke the assembly process, the user submits a statement
patterned as follows:
ASM2EXE filename
or
ASM2EXE filename /H
or
ASM2EXE filename libname
where "filename" is the file name of the assembly source and "libname"
is the name of a single library file--BOTH WITH NO EXTENSION! Assuming
the files exist, an EXE file will be produced as described above.
ASM2CREF.BAT
This batch file provides an automated method of producing a cross
reference listing from a single assembly language source file. In
addition to the cross reference listing, a LST file is also generated.
The .CRF file (a by-product of the process) is deleted after use. Other
files are not generated.
ASM2CREF does some rudimentary input checking to insure the source
is not accidentally destroyed or that the processors are not invoked for
nonexistent files. Any options specified (field 2) are assumed to be
for the assembler. Options are not checked, just applied.
Following the assembler invocation, ERRORLEVEL 1 is checked. The
IBM Macro Assembler (and for all I know versions of the Microsoft Macro
Assembler after 1.27) will set the ERRORLEVEL flag if errors are
detected. The following ECHO and PAUSE statements, REM'd out, provide a
similar function if the assembler does not set the ERRORLEVEL flag.
To invoke the cross reference listing process, a statement
patterned after the following is submitted:
ASM2CREF filename [options]
where "filename" is the filename (no extension) of the file for which a
cross reference listing is desired and "[options]" are any assembler
parameters desired. The output files will have extensions of LST for
the assembler listing and REF for the output from the cross reference
program CREF.EXE.
ASM2LIB.BAT
ASM2LIB is intended to provide a more convenient method of handling
common object code library file activities. Where possible, error
checking (and double checking what the user really wants to do) is
performed.
To invoke the library manager, a statement patterned after one of
the following show be submitted:
ASM2LIB libname
or
ASM2LIB libname filename
where "libname" is the name of a library and "filename" is the name of
an assembly language source file (neither filename should have an
extension--the proper extensions are assumed). When invoked, a menu of
choices is displayed. Selection is made by pressing the numeric key
corresponding to the execution choice.
0) Create library file
This procedure will create a new (empty) library file. If a
library file of the specified name already exists, a query is to
determine if the file should be replaced. If the response is "Y"
(either upper or lower case), then the existing file is renamed
with an extension of "BAK". (If a BAK file already exists,
execution is terminated with nothing changed.)
1) Review existing library file
This procedure lists the existing entries in a specified library.
For convenience, the DOS MORE command is used to control the
listing on the screen. (A hard copy is produced in REVIEW.LST).
Depending on the user, the MORE might be replaced with a
COPY REVIEW.LST PRN
or a favorite file to screen listing program.
2) Assemble and add to library
This procedure assembles the "filename" and adds the OBJ file
produced to "libname" replacing any existing entry of that name.
The same checking done for ASM2COM and ASM2EXE is also done here.
The OBJ file is also deleted after being added to the library.
3) Delete entry from library
This procedure deletes the "filename" entry from the library. (Just
in case, one last "Are you sure?" query is made of the user. As
with creation, "Y" permits deletion.)
Notes:
1. QUERY.COM displays a comment and expects a single character
response. Digits 0-9 or Y/N are valid inputs. Output is an
ERRORLEVEL corresponding to the digit or a one if the input is
"Y". Any other response results in a prompt requesting entry of
a valid prompt.
2. LIBSETUP.COM pokes "Y///" into the IBM PC keyboard buffer which
is what LIB.EXE is looking for when a library file is being
created. THIS ROUTINE MAY NOT WORK FOR SO-CALLED COMPATIBLES!